package com.zust.zst.score.service.impl;

import com.zust.zst.common.dto.score.AddScoreDTO;
import com.zust.zst.common.dto.score.Score;

import com.zust.zst.common.dto.score.UpdateScoreDTO;
import com.zust.zst.dao.mapper.score.ScoreMapper;
import com.zust.zst.score.service.ScoreService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("scoreServiceImpl")
public class ScoreServiceImpl implements ScoreService{
  @Resource
    private ScoreMapper scoreMapper;
    public List<Score> showAllStudentScore(int startIndex, int pageSize) {
        return scoreMapper.showAllStudentScore(startIndex,pageSize);
    }

    @Override
    public int getScoreCount() {
        return scoreMapper.getScoreCount();
    }
//    public int showCountScore() {
//        return scoreService.showCountScore();
//    }

public int deleteScore(int scoreId) {
    return scoreMapper.deleteScore(scoreId);
}

    @Override
    public List<Score> getScoreById(int scoreId) {
        return scoreMapper.getScoreById(scoreId);
    }

    @Override
    public List<Score> getScoreBySubId(int studentSubjectId) {
        return scoreMapper.getScoreBySubId(studentSubjectId);
    }

    @Override
    public void addScore(AddScoreDTO addScoreDTO) {
        scoreMapper.addScore(addScoreDTO);

    }
    @Override
    public void updateScore(UpdateScoreDTO updateScoreDTO){
        scoreMapper.updateScore(updateScoreDTO);

    }
}
